#include "lib/pvmstrings.h"
#include <tchar.h>
#include <string.h>

#include "lib/memory/pvmmemory.h"

pvm_size pvm_strlen(const pvm_char* str)
{
	return _tcslen((const TCHAR*)str);
}

pvm_size pvm_strcmp(const pvm_char* str1, const pvm_char* str2)
{
	return _tcscmp((const TCHAR*)str1, (const TCHAR*)str2);
}

pvm_size pvm_strncmp(const pvm_char* str1, const pvm_char* str2, pvm_size count)
{
	return _tcsncmp((const TCHAR*)str1, (const TCHAR*)str2, count);
}

pvm_char* pvm_strcpy(pvm_char* strDst, const pvm_char* strSrc)
{
	return (pvm_char*)_tcscpy((TCHAR*)strDst, (const TCHAR*)strSrc);
}

pvm_char* pvm_strcat(pvm_char* strDst, const pvm_char* strSrc)
{
	return (pvm_char*)_tcscat((TCHAR*)strDst, (const TCHAR*)strSrc);
}

pvm_int pvm_vsprintf(pvm_char* buffer, pvm_size maxLen, const pvm_char* format, va_list args)
{
	return vswprintf((TCHAR*)buffer, maxLen, (const TCHAR*)format, args);
}